﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;

namespace Paint
{
    class VeTuDo:HinhVe
    {
        List<Point> _listPoint;

        public List<Point> ListPoint
        {
            get { return _listPoint; }
            set { _listPoint = value; }
        }

        public VeTuDo(HinhVe HV)
        {
            this._bimap = HV.Bimap;
            this._graphics = Graphics.FromImage(this._bimap);
            this._pen = HV.Pen;
            this._listPoint = new List<Point>();
        }

        public override void VeHinh()
        {
            if (ListPoint.Count == 2)
            {
                Graphics.FillRectangle(ChoiVe, ListPoint[0].X, ListPoint[0].Y, 1, 1);
            }
            else
            {
                Graphics.DrawCurve(Pen, ListPoint.ToArray());
            }
        }
    }
}
